Skip to content

Drawings: sheet tables and the revision record move from the geometry crate to the drawing code (#22853) - #22854

Draft
CamWight wants to merge 4 commits into
tangency-labs:mainfrom
CamWight:geom-table-move
Draft

CamWight wants to merge 4 commits into
tangency-labs:mainfrom
CamWight:geom-table-move

Conversation

@CamWight

@CamWight CamWight commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Change

A drawing's sheet tables (parts lists and revision tables) are laid out by code that still lived in crates/geom, the geometry crate, along with the drawing's revision record. This PR moves that code to crates/doc/src/drawing/, next to the rest of the drawing code. It's a pure move: nothing works differently, and nothing on screen or in a saved file changes.

Fixes #22853

Why:

  • Only doc and the crates above it use these files.
  • geom only shrinks now (CONTRIBUTING.md:25-26: "crates/kernel, crates/smlib and crates/geom only shrink toward the seam (ops, tess, record); please don't grow them").
  • It's sheet layout, not kernel maths. cargo xtask app-geometry flags nothing in it.
From To
crates/geom/src/table.rs crates/doc/src/drawing/table_layout.rs
crates/geom/src/table_tests.rs crates/doc/src/drawing/table_layout_tests.rs
crates/geom/src/revision.rs crates/doc/src/drawing/revision.rs
crates/geom/src/revision_tests.rs crates/doc/src/drawing/revision_tests.rs

I picked table_layout because doc already has drawing/table.rs, the saved SheetTable record. The four files are git renames (97% to 100% similar), so git log --follow and blame keep their history.

What changes besides the move, all paths:

  • geom: the two mod lines go. cell::is_snake_case becomes pub, because the table layout and the title block share that one naming rule.
  • doc:
    • drawing.rs gets pub mod revision; and pub mod table_layout; in its sorted group.
    • Six drawing files import from super:: instead of solidcraft_geom::.
    • revision.rs imports the layout as super::table_layout::{self as table, ..}, so its own table::Row lines stay as they were.
  • engine: nine files import from solidcraft_doc::drawing::{table_layout, revision}.
  • ui-egui: one line in drawing_workspace/panels.rs moves from the geom::{ import block to the doc::drawing::{ one. That's the only touch on @Nathan-Dane's drawing UI, and it changes nothing there but the path.

A revision row's sheet id still reads through geom's id reader (solidcraft_geom::ids::option), so a bad id gives the same message as before. geom can't keep a re-export under the old paths: geom would then depend on doc, a higher layer (cargo xtask layers). So every caller changes here.

Changes a default: no

Validation

Local, Windows, --profile ci, on 15da792 (main a9ff9fe):

  • cargo check (one crate at a time, upward):
    • geom, doc, engine and ui-kit, all targets: pending (the run is queued; this stays a draft until it passes);
    • ui-egui --lib: pending (the run is queued; this stays a draft until it passes).
  • The 25 moved tests by name in their new home: table_layout's 15 and revision's 10, cargo test -p solidcraft-doc --lib -- drawing::table_layout::tests drawing::revision::tests: pending (the run is queued; this stays a draft until it passes).
  • The engine tests that use the moved code: drawing_table_paper::tests and cmd::drawing_revision::tests, 14 by name: pending (the run is queued; this stays a draft until it passes).
  • io's check that a model is computed without the display crates (a_model_is_computed_without_the_display_crates): pending (the run is queued; this stays a draft until it passes).
  • cargo xtask app-geometry: pending (the run is queued; this stays a draft until it passes). The four files call none of the flagged methods, and xtask/app-geometry.txt doesn't change.
  • cargo xtask lists: pending (the run is queued; this stays a draft until it passes).
  • cargo xtask ci on this head: pending (the run is queued; this stays a draft until it passes).
  • rustfmt (1.99.1, edition 2024) on all 23 touched files: clean.
  • git grep finds no use of geom::table or geom::revision left in crates/, apps/ or xtask/. That includes the solidcraft_engine::geom:: re-export.

No planted faults: no logic changed, so a fault would only test geom's code again. No new tests, and no existing test line changed.

Screenshots of the behavior (when observable)

None. Nothing visible changes.

Integration status

On main a9ff9fe, checked against all 763 open PRs on 26 Nov. Outside the moved files, the move changes 21 lines in 19 files. A PR touching one of them needs a one-line fix:

I'll send @mariogeiger and @KazW the one-line fix once this lands. #13058 and #22084 merge main in on top of it, so their table and revision work lands in doc.

Follow-up, not here: crates/geom/src/ids.rs:7-8 still gives "a revision record's rows" as the reason ids live in geom. After the move, the reason is the title block's image field (title_block.rs:96). It's a one-comment change.

Next, building on this PR: "Drawings: the title block and cell content move from the geometry crate to the drawing code (#23140)" (#23141) moves the title block and cell content to doc the same way.

CamWight and others added 2 commits November 26, 2026 22:55
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…om into doc's drawing code

A pure move, no logic change. Only doc and the crates above it use them,
and crates/geom only shrinks (CONTRIBUTING.md:25-26).

- crates/geom/src/table.rs -> crates/doc/src/drawing/table_layout.rs
  (doc already has drawing/table.rs, the saved SheetTable record), with
  table_tests.rs -> table_layout_tests.rs;
- crates/geom/src/revision.rs and revision_tests.rs -> crates/doc/src/drawing/.

Paths only:
- the moved files name geom's items as solidcraft_geom::...; revision.rs
  reads the layout as super::table_layout (`self as table`, so its
  table::Row and table::Filter lines stay as they were);
- RevisionRow::sheet keeps geom's id reader (solidcraft_geom::ids::option),
  so a bad id gives the same message as before;
- geom: the two mod lines go, and cell::is_snake_case becomes pub (the
  layout and the title block share that one rule);
- doc, engine and ui-egui callers use solidcraft_doc::drawing::{table_layout,
  revision} (doc's own files: super::...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
Pre-merge checks: Passed 1

Check name Status Explanation
Existing Defaults Unchanged Passed The check fails only if the PR changes a UX default (setting or preference values, command or tool behaviour in normal use, default UI layout or behaviour, shortcuts). The PR's own commit 15da792 i…
Full details: Existing Defaults Unchanged

Explanation

The check fails only if the PR changes a UX default (setting or preference values, command or tool behaviour in normal use, default UI layout or behaviour, shortcuts). The PR's own commit 15da792 is a pure move. It has 23 files changed, 37 insertions and 37 deletions. Inspecting the diff shows only path and import changes: the four files are renamed from crates/geom/src to crates/doc/src/drawing. Other edits are solidcraft_geom::ids::option and solidcraft_doc::drawing::... paths, #[path = "table_layout_tests.rs"], pub mod lines, and is_snake_case going from pub(crate) to pub. The #[serde(default, ...)] attribute keeps its default; only its path changes. The ui-egui panels change is an import path move. None of these alters a setting value, a command's usual behaviour, a layout, a shortcut, or a saved default. The description's "Changes a default: no" matches the code. The check does not apply to changes that are purely additive, and this PR adds nothing user-facing. Note: the local checkout's origin/main comparison is noisy because main has moved on, so I relied on the PR commit's own diff against its parent.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport labels Nov 26, 2026
CamWight added a commit to CamWight/solidcraft that referenced this pull request Nov 30, 2026
…-labs#13058

Four files conflicted (params.rs twice):
- expr.rs: main split the uncached evaluation so driven dimensions can seed it (tangency-labs#14426);
  `eval_params_uncached` keeps this PR's pub(crate) and note, for a configuration's definitions.
- params.rs, change_params_atomic: this PR's one lookup (param_target, stored_expression), with
  main's refusal of a read-only driven dimension parameter first.
- params.rs, param_defs: main's walk of input expressions (tangency-labs#1147, no String per input) with this
  PR's input_def; the design's length unit is read once per call (design_length_unit), as main
  does, and input_def takes it.
- drawing/table.rs: this PR's check for every kind that lists a source (Kind::of), with main's
  allowance for a list placed unbound before the drawing has a source (is_unbound).
- drawing_workspace/browser.rs: this PR's family and general table rows, read with tr!.

Three gaps git merged without a conflict, which the doc compile found:
- config.rs: the merge kept both import lines; this PR's line already
  names BTreeMap, BTreeSet and HashMap, so main's shorter one goes.
- drawing/table_tests.rs: main gave ConfigRow a fixed id (tangency-labs#14750); this
  PR's family-table tests now give each row its own id, as main's tests do.
- drawing/table_layout_tests.rs: main added Filter::ballooned; this PR's two
  filter literals say ballooned: None.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KazW

KazW commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

#22250 merged first, so the one line I said I'd change is now on main: crates/engine/src/cmd/drawing_table_tests.rs:699 uses solidcraft_geom::table::Row. When you next merge main, it becomes solidcraft_doc::drawing::table_layout::Row. If you'd rather leave it, tell me and I'll send it as a fix right after this merges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:doc timeline, components, parameters, naming area:kernel B-rep kernel, booleans, blends, STEP/IGES area:ui desktop/web front end, dialogs, viewport

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drawings: move the sheet table layout and the revision record out of geom into doc

2 participants